import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)


// 路由配置
const routes = [
	{
		path: '/',
		title: '重定向',
		name: 'main',
		redirect: '/home'
	},
	{
		path: '/home',
		title: '首页',
		name: 'home',
		component: resolve => require(['../views/home.vue'],resolve)
		//component: () => import('../views/home.vue')
	},
	{
		path: '/content',
		title: '内容',
		name: 'content',
		component: () => import('../views/content.vue')
	}
]


const router = new VueRouter({
    routes
})
router.beforeEach((to, from, next)=>{
	console.log(to)
	next()
})
export default router
